package com.treasure.mall.zbqmallapi.vo.integral;

import com.treasure.mall.biz.entity.embeddable.ReceivingInfo;
import com.treasure.mall.biz.entity.integral.IntegralOrderPO;
import com.treasure.mall.biz.vo.BaseVO;
import com.treasure.mall.zbq.common.ienum.order.OrderEnums;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author allan
 * @version 1.0.0
 * @date 2020/8/25
 */
@Data
@NoArgsConstructor
public class OrderVO implements BaseVO {
    private static final long serialVersionUID = -4837386619987579341L;

    private String id;
    /**
     * 兑换用户
     */
    private Long userId;
    /**
     * 商品
     */
    private IntegralOrderPO.Product product;
    private int num;
    private long totalIntegral;
    private long finalIntegral;
    /**
     * 收货地址{@link ReceivingInfo}
     */
    private ReceivingInfo receivingInfo;
    /**
     * 优惠了多少积分
     */
    private long pmtIntegral;
    /**
     * 发货状态
     */
    private OrderEnums.DeliverStatus deliverStatus;

    public OrderVO(IntegralOrderPO po) {
        this.id = po.getId();
        this.userId = po.getUserPO().getUserId();
        this.product = po.getProduct();
        this.receivingInfo = po.getReceivingInfo();
        this.pmtIntegral = po.getPmtIntegral();
        this.num = po.getNum();
        this.totalIntegral = po.getTotalIntegral();
        this.finalIntegral = po.getTotalIntegral();
        this.deliverStatus = po.getDeliverStatus();
    }
}
